<style>
table.basemenu {
  width: 230px;
  border-bottom: 3px solid #aaaaaa;
  border-top: 2px solid #aaaaaa;
  margin-right: 40px;
}
table.basemenu td {
  border-left: 3px solid #aaaaaa;
  border-right: 3px solid #aaaaaa;
  border-top: 1px solid #aaaaaa;
  cursor: pointer;
  font-weight: bold;
}
table.basemenu td.normal:hover {
  background-color: #cccccc;
}
table.basemenu td.hi {
  background-color: #cccccc;
}
.subtitle {
  font-family: Arial Black;
  font-size: 13px;
  font-weight: bold;
  padding-left: 20px;
  margin-bottom: 5px;
  color: #000000;
}
table.menus {
  width: 100%;
}
table.menus td {
  font-weight: normal;
  border: none;
  padding: 0 0 0 15px;
}
table.menus td a {
  text-decoration: underline;
  color: #a6a6a6;
  font-size: 11px;
}
table.menus td a.hi {
  text-decoration: none;
  font-weight: bold;
  font-size: 11px;
}
</style>

<!-- Normal -->
<div class="subtitle">BASIC</div>
<table class="basemenu" style="margin-bottom: 30px;" cellPadding="15" cellSpacing="0">
  <tr><td {{if $t == 'pages' || $t == 'pagecreate' || $t == 'page'}}class="hi"{{else}}class="normal"{{/if}} onclick="location.href='admin.php?t=pages';">{{t escape='html'}}Pages{{/t}}</td></tr>
  <tr><td id="basemenu_m" style="display: none;padding: 0;"></td></tr>
  <tr><td {{if $t == 'themes' || $t == 'theme'}}class="hi"{{else}}class="normal"{{/if}} onclick="location.href='admin.php?t=themes';">{{t escape='html'}}Appearance{{/t}}</td></tr>
  <tr><td {{if $t == 'plugins'}}class="hi"{{else}}class="normal"{{/if}} onclick="location.href='admin.php?t=plugins';">{{t escape='html'}}Plugins{{/t}}</td></tr>
  <tr><td {{if $t == 'modules'}}class="hi"{{else}}class="normal"{{/if}} onclick="location.href='admin.php?t=modules';">{{t escape='html'}}Modules{{/t}}</td></tr>
  <tr><td {{if $t == 'profile' || $t == 'profile_user'}}class="hi"{{else}}class="normal"{{/if}} onclick="location.href='admin.php?t=profile&i=1';">{{t escape='html'}}Settings{{/t}}</td></tr>
</table>

<!-- eCommerce -->
<div class="subtitle" style="display: none;">ECOMMERCE</div>
<table class="basemenu" style="display: none; margin-bottom: 30px;" cellPadding="15" cellSpacing="0">
  <tr><td {{if $t == 'categories' || $t == 'category'}}class="hi"{{else}}class="normal"{{/if}} onclick="location.href='admin.php?path=ecommerce&t=categories';">{{t escape='html'}}Categories{{/t}}</td></tr>
  <tr><td {{if $t == 'products' || $t == 'product'}}class="hi"{{else}}class="normal"{{/if}} onclick="location.href='admin.php?path=ecommerce&t=products';">{{t escape='html'}}Products{{/t}}</td></tr>
  <tr><td {{if $t == 'payments' || $t == 'payment'}}class="hi"{{else}}class="normal"{{/if}} onclick="location.href='admin.php?path=ecommerce&t=payments';">{{t escape='html'}}Payment Methods{{/t}}</td></tr>
  <tr><td {{if $t == 'shippings' || $t == 'shipping'}}class="hi"{{else}}class="normal"{{/if}} onclick="location.href='admin.php?path=ecommerce&t=shippings';">{{t escape='html'}}Shipping Methods{{/t}}</td></tr>
  <tr><td {{if $t == 'customers' || $t == 'customer'}}class="hi"{{else}}class="normal"{{/if}} onclick="location.href='admin.php?path=ecommerce&t=customers';">{{t escape='html'}}Customers{{/t}}</td></tr>
  <tr><td {{if $t == 'orders' || $t == 'order'}}class="hi"{{else}}class="normal"{{/if}} onclick="location.href='admin.php?path=ecommerce&t=orders';">{{t escape='html'}}Orders{{/t}}</td></tr>
  <tr><td {{if $t == 'parcels' || $t == 'parcel'}}class="hi"{{else}}class="normal"{{/if}} onclick="location.href='admin.php?path=ecommerce&t=parcels';">{{t escape='html'}}Parcels{{/t}}</td></tr>
  <tr><td {{if $t == 'transactions' || $t == 'transaction'}}class="hi"{{else}}class="normal"{{/if}} onclick="location.href='admin.php?path=ecommerce&t=transactions';">{{t escape='html'}}Transactions{{/t}}</td></tr>
</table>
<script src="jsrequest.php?script=basemenu" type="text/javascript"></script>
<script type="text/javascript">
  <!--
    var _m = {{if $t == 'page'}}JSON.parse('{{$m|@json_encode|escape:'javascript'}}'){{else}}{}{{/if}};
    var _menus = {{if isset($menus)}}JSON.parse('{{$menus|@json_encode|escape:'javascript'}}'){{else}}[]{{/if}};
    
    init();
    
    function init() {

      if (_m.id != undefined) {
        var elm, table;
        elm = document.getElementById('basemenu_m');
        elm.style.display = 'table-cell';
        
        table = document.createElement('table');
        table.className = 'menus';
        table.cellPadding = 0;
        table.cellSpacing = 0;
        elm.appendChild(table);
        
        setPages(_m, table, []);
      }
    }
    
    function setPages(node, table, nums) {
      var tr, td, elm;
      
      if (node.id > 0) {
        tr = table.insertRow(-1);
        
        td = tr.insertCell(-1);
        td.style.height = '30px';
        elm = document.createElement('a');
        elm.href = 'admin.php?t=page&i=' + node.id;
        elm.style.marginLeft = (nums.length) * 15 + 'px';
        if (_menus.length > 0 && node.id == _menus[0].id) {
          elm.className = 'hi';
        }
        var tmp = node.name;
        if (node.name.length > 20) {
          tmp = MiscUtils.getShortName(node.name, 20);
        }
        elm.appendChild(document.createTextNode(tmp));
        td.appendChild(elm);
        
      } else {
        DOMUtils.removeTableRows(table, 0);
      }
      
      for (var idx in node.c) {
        var obj = node.c[idx];
        nums.push(parseInt(idx, 10) + 1);
        setPages(obj, table, nums);
        nums.pop();
      }
    }
  // -->
</script>

{{foreach $mdus as $mdu}}
  <div class="subtitle">{{$mdu->name|upper|escape:html}}</div>
  <table class="basemenu" style="margin-bottom: 30px;" style="margin-bottom: 30px;" cellPadding="15" cellSpacing="0">
    {{foreach $mdu->menus as $menu}}
      <tr><td {{if $t == 'customm' && $folder == $mdu->folder && $mmenu == $menu->arg}}class="hi"{{else}}class="normal"{{/if}} onclick="location.href='admin.php?t=customm&folder={{$mdu->folder|escape:html}}&arg={{$menu->arg|escape:html}}';">{{$menu->name|escape:html}}</td></tr>
    {{/foreach}}
  </table>
{{/foreach}}
